/*
 * CODE GENERATED AUTOMATICALLY WITH github.com/alanctgardner/gogen-avro
 * THIS FILE SHOULD NOT BE EDITED BY HAND
 *
 * SOURCE:
 *     tcp.avsc
 */

package avro

import (
	"io"
)

type TCP struct {
	Length          UnionIntNull
	Time            UnionLongNull
	SrcMAC          UnionStringNull
	DstMAC          UnionStringNull
	NetworkProtocol UnionStringNull
	IHL             UnionIntNull
	TOS             UnionIntNull
	Id              UnionIntNull
	Flags           UnionStringNull
	FragOffset      UnionIntNull
	TTL             UnionIntNull
	SrcIP           UnionStringNull
	DstIP           UnionStringNull
	TransportProtol UnionStringNull
	SrcPort         UnionIntNull
	DstPort         UnionIntNull
	Seq             UnionLongNull
	Ack             UnionLongNull
	FIN             UnionBoolNull
	SYN             UnionBoolNull
	RST             UnionBoolNull
	PSH             UnionBoolNull
	ACK             UnionBoolNull
	URG             UnionBoolNull
	ECE             UnionBoolNull
	CWR             UnionBoolNull
	NS              UnionBoolNull
	Window          UnionIntNull
	CheckSum        UnionIntNull
}

func DeserializeTCP(r io.Reader) (*TCP, error) {
	return readTCP(r)
}

func NewTCP() *TCP {
	v := &TCP{}

	return v
}

func (r *TCP) Schema() string {
	return "{\"fields\":[{\"name\":\"length\",\"type\":[\"int\",\"null\"]},{\"name\":\"time\",\"type\":[\"long\",\"null\"]},{\"name\":\"SrcMAC\",\"type\":[\"string\",\"null\"]},{\"name\":\"DstMAC\",\"type\":[\"string\",\"null\"]},{\"name\":\"NetworkProtocol\",\"type\":[\"string\",\"null\"]},{\"name\":\"IHL\",\"type\":[\"int\",\"null\"]},{\"name\":\"TOS\",\"type\":[\"int\",\"null\"]},{\"name\":\"id\",\"type\":[\"int\",\"null\"]},{\"name\":\"flags\",\"type\":[\"string\",\"null\"]},{\"name\":\"FragOffset\",\"type\":[\"int\",\"null\"]},{\"name\":\"TTL\",\"type\":[\"int\",\"null\"]},{\"name\":\"SrcIP\",\"type\":[\"string\",\"null\"]},{\"name\":\"DstIP\",\"type\":[\"string\",\"null\"]},{\"name\":\"TransportProtol\",\"type\":[\"string\",\"null\"]},{\"name\":\"SrcPort\",\"type\":[\"int\",\"null\"]},{\"name\":\"DstPort\",\"type\":[\"int\",\"null\"]},{\"name\":\"Seq\",\"type\":[\"long\",\"null\"]},{\"name\":\"Ack\",\"type\":[\"long\",\"null\"]},{\"name\":\"FIN\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"SYN\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"RST\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"PSH\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"ACK\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"URG\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"ECE\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"CWR\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"NS\",\"type\":[\"boolean\",\"null\"]},{\"name\":\"Window\",\"type\":[\"int\",\"null\"]},{\"name\":\"CheckSum\",\"type\":[\"int\",\"null\"]}],\"name\":\"TCP\",\"namespace\":\"com.lee\",\"type\":\"record\"}"
}

func (r *TCP) Serialize(w io.Writer) error {
	return writeTCP(r, w)
}
